<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>@yield('title')</title>
    <meta name="keywords" content="@yield('keywords')">
    <meta name="description" content="@yield('description')">

    <link href="{{ asset('layui/css/layui.css') }}" rel="stylesheet">
    <link href="{{ asset('css/css.css') }}" rel="stylesheet">
    <link rel="shortcut icon" href="{{ url('img/favicon.ico') }}">
</head>
<body>
    <header class="layui-bg-black">
        <nav class="layui-container">
            <div class="logo">
                <a href="{{ url('/') }}">
                    <img src="{{ url('logo.png') }}" alt="好年年">
                </a>
            </div>
            <ul class="layui-nav layui-layout-left layui-hide-xs">
                <li class="layui-nav-item @if(trim(Route::currentRouteName()) == 'root') layui-this @endif">
                    <a href="{{ url('/') }}" title="首页">首页</a>
                </li>
                <li class="layui-nav-item @if(stripos('==='.trim(Route::currentRouteName()),'site')) layui-this @endif">
                    <a href="{{ url('/site') }}/" title="秀目录">好年年</a>
                </li>
                <li class="layui-nav-item @if(stripos('==='.trim(Route::currentRouteName()),'article')) layui-this @endif">
                    <a href="{{ url('/article') }}/" title="秀资讯">好年年资讯</a>
                </li>
                <span class="layui-nav-bar" style="left: 0px; top: 57px; width: 0px; opacity: 0;"></span>
            </ul>
            <ul class="layui-nav layui-layout-right">
                @guest
                    <li class="layui-nav-item">
                        <a href="{{ route('register') }}"> 注册 </a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="{{ route('login') }}"> 登录 </a>
                    </li>
                @else
                    <li class="layui-nav-item">
                        <a href="{{ route('home') }}"> 个人中心 </a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="{{ route('logout') }}"
                           onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                            退出
                        </a>

                        <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                            {{ csrf_field() }}
                        </form>
                    </li>
                    <span class="layui-nav-bar" style="left: 30px; top: 57px; width: 0px; opacity: 0;"></span>
                @endguest
            </ul>
        </nav>
    </header>
    <div class="layui-container">
        @yield('content')
    </div>
    <footer class="layui-bg-black">
        <div class="layui-container">
            <div class="foot-link">
                @inject('pages', 'App\Models\Pages')
                @if($pages)
                    @foreach($pages->get() as $v)
                        <a href="{{ url('/pages/'.$v->id) }}.html" title="{{ $v->title }}">{{ $v->title }}</a>|
                    @endforeach
                @endif
                <a href="#" title="网站地图">网站地图</a>
            </div>
            <div class="copyright">
                <p>
                    <span>Powered by 长治华券信息技术有限公司 © 2015-2018 <a href="{{ url('/') }}" title="好年年">好年年</a> All Rights Reserved  晋ICP备15009430号</span>
                </p>
                <p>
                    <span>免责申明：请勿在本站发布非法、色情等不良信息，所有个人言论并不代表本站立场。本站内容来自互联网，如有侵权请联系站长删除！</span>
                </p>
                <p>

                </p>
            </div>
        </div>
    </footer>

    <!-- Scripts -->
    <script src="{{ asset('layui/layui.all.js') }}"></script>
    <script src="{{ asset('js/gt.js') }}"></script>
    @yield('scriptsAfterJs')
</body>
</html>
